import { Space } from 'antd';
import React from 'react';
import { useModel } from '@umijs/max';
import useRoleList from '../RoleList';
import Avatar from './AvatarDropdown';

export type SiderTheme = 'light' | 'dark';

const GlobalHeaderRight: React.FC = () => {
  const { initialState } = useModel('@@initialState');
  const roleListEle = useRoleList();
  if (!initialState || !initialState.settings) {
    return null;
  }

  return (
    <Space>
      <span>{roleListEle}</span>
      <Avatar />
    </Space>
  );
};
export default GlobalHeaderRight;
